package com.yesorno.activity;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.text.TextPaint;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.RelativeLayout;
import android.widget.TextView;

/**
 * 大厅的菜单
 * 
 * @author samoin
 * @version 0.1
 * @since 2011-08-08
 * 
 */
public class HallMenuActivity extends Activity {

	private RelativeLayout hall_menu_detail;
	private RelativeLayout hall_menu_userinfo;

	private long currentTopicId = 0;
	private long currentUserId = 0;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.hall_menu);

		TextView hall_menu_title = (TextView) findViewById(R.id.hall_menu_title);
		TextPaint tp = hall_menu_title.getPaint();
		tp.setFakeBoldText(true);

		hall_menu_detail = (RelativeLayout) findViewById(R.id.hall_menu_detail);
		hall_menu_userinfo = (RelativeLayout) findViewById(R.id.hall_menu_userinfo);
		MyOnClickListener mocl = new MyOnClickListener();
		hall_menu_detail.setOnClickListener(mocl);
		hall_menu_userinfo.setOnClickListener(mocl);
		Intent intent = getIntent();
		currentTopicId = intent.getLongExtra("currentTopicId", 0);
		currentUserId = intent.getLongExtra("currentUserId", 0);
	}

	class MyOnClickListener implements OnClickListener {

		@Override
		public void onClick(View v) {
			if (v == hall_menu_detail) {
				Intent intent = new Intent();
				intent.putExtra("currentTopicId", currentTopicId);
				intent.setClass(HallMenuActivity.this,
						TopicDetailActivity.class);
				startActivity(intent);
			}
			if (v == hall_menu_userinfo) {
				Intent intent = new Intent();
				intent.putExtra("currentUserId", currentUserId);
				intent.setClass(HallMenuActivity.this, UserInfoActivity.class);
				startActivity(intent);
			}
		}

	}

}
